//
//  RegistrateViewController.m
//  必争医疗
//
//  Created by 毕成 on 14-11-20.
//  Copyright (c) 2014年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "RegistrateViewController.h"
#import "LogViewController.h"
@interface RegistrateViewController ()

@end

@implementation RegistrateViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self.view setBackgroundColor:[UIColor lightGrayColor]];
    [self.navigationItem setTitle:@"注册账号"];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"left.png"] style:UIBarButtonItemStyleDone target:self action:@selector(leftAction:)];
    [self.tabBarController.tabBar setHidden:YES];
    
    [self creatView];
}

- (void)leftAction:(id)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)creatView
{
    UILabel *title = [[[UILabel alloc] initWithFrame:CGRectMake(0, 64, self.view.frame.size.width, 40)] autorelease];
    [title setText:@"新用户注册赢金币"];
    title.textAlignment = NSTextAlignmentCenter;
    title.font = [UIFont fontWithName:@"Helvetica-Bold" size:20];
    [self.view addSubview:title];
    
    UILabel *foot = [[UILabel alloc] initWithFrame:CGRectMake(0, 64 + title.frame.size.height, title.frame.size.width, 20)];
    [foot setText:@"注册账号后即可获得医生的专业解答"];
    foot.textAlignment = NSTextAlignmentCenter;
    foot.font = [UIFont fontWithName:nil size:15];
    [self.view addSubview:foot];
    
    UILabel *message = [[[UILabel alloc] initWithFrame:CGRectMake(10, foot.frame.origin.y + foot.frame.size.height + 30, 355, 40)] autorelease];
    [message setBackgroundColor:[UIColor greenColor]];
    [message setText:@"短信注册"];
    message.textAlignment = NSTextAlignmentCenter;
    message.textColor = [UIColor whiteColor];
    [self.view addSubview:message];
    
    UILabel *phone = [[[UILabel alloc] initWithFrame:CGRectMake(message.frame.origin.x, message.frame.size.height + message.frame.origin.y + 15, message.frame.size.width, message.frame.size.height)] autorelease];
    [phone setBackgroundColor:[UIColor greenColor]];
    [phone setText:@"手机号注册"];
    phone.textAlignment = NSTextAlignmentCenter;
    phone.textColor = [UIColor whiteColor];
    [self.view addSubview:phone];
    
    UILabel *log = [[[UILabel alloc] initWithFrame:CGRectMake(phone.frame.origin.x, phone.frame.origin.y + phone.frame.size.height + 25, phone.frame.size.width, phone.frame.size.height)] autorelease];
    [log setBackgroundColor:[UIColor grayColor]];
    [log setText:@"已有账号，直接登录"];
    log.textAlignment = NSTextAlignmentCenter;
    log.textColor = [UIColor whiteColor];
    [self.view addSubview:log];
    UIButton *logButton = [[[UIButton alloc] initWithFrame:CGRectMake(log.frame.origin.x, log.frame.origin.y, log.frame.size.width, log.frame.size.height)] autorelease];
    [logButton setBackgroundColor:[UIColor clearColor]];
    [logButton addTarget:self action:@selector(logAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:logButton];
    
    UIView *root = [[[UIView alloc] initWithFrame:CGRectMake(0, log.frame.origin.y + log.frame.size.height + 25, self.view.frame.size.width, 200)] autorelease];
    [root setBackgroundColor:[UIColor whiteColor]];
    [self.view addSubview:root];
    UILabel *head = [[[UILabel alloc] initWithFrame:CGRectMake(0, 0, root.frame.size.width, 20)] autorelease];
    [head setText:@"或使用以下账号登录"];
    head.font = [UIFont fontWithName:nil size:12];
    head.textAlignment = NSTextAlignmentCenter;
    [root addSubview:head];
    //微博登录
    UIImageView *microblogImage = [[[UIImageView alloc] initWithFrame:CGRectMake(30, head.frame.origin.y + head.frame.size.height + 35, 80, 80)] autorelease];
    [microblogImage setImage:[UIImage imageNamed:@"微博"]];
    microblogImage.clipsToBounds = YES;
    microblogImage.layer.cornerRadius = microblogImage.frame.size.width/2;
    [root addSubview:microblogImage];
    UIButton *microblogButton = [[[UIButton alloc] initWithFrame:CGRectMake(microblogImage.frame.origin.x, microblogImage.frame.origin.y, microblogImage.frame.size.width, microblogImage.frame.size.height)] autorelease];
    [microblogButton setBackgroundColor:[UIColor clearColor]];
    [root addSubview:microblogButton];
    //微信登录
    UIImageView *messageImage = [[[UIImageView alloc] initWithFrame:CGRectMake(microblogButton.frame.origin.x + microblogButton.frame.size.width + 35, microblogButton.frame.origin.y, microblogButton.frame.size.width, microblogButton.frame.size.height)] autorelease];
    [messageImage setImage:[UIImage imageNamed:@"微信"]];
    messageImage.clipsToBounds = YES;
    messageImage.layer.cornerRadius = messageImage.frame.size.width/2;
    [root addSubview:messageImage];
    UIButton *messageButton = [[[UIButton alloc] initWithFrame:CGRectMake(messageImage.frame.origin.x, messageImage.frame.origin.y, messageImage.frame.size.width, messageImage.frame.size.height)] autorelease];
    [messageButton setBackgroundColor:[UIColor clearColor]];
    [root addSubview:messageButton];
    //qq登录
    UIImageView *qqImage = [[[UIImageView alloc] initWithFrame:CGRectMake(messageButton.frame.origin.x + messageButton.frame.size.width + 35, messageButton.frame.origin.y, microblogButton.frame.size.width, messageButton.frame.size.height)] autorelease];
    [qqImage setImage:[UIImage imageNamed:@"qq"]];
    qqImage.clipsToBounds = YES;
    qqImage.layer.cornerRadius = qqImage.frame.size.width/2;
    [root addSubview:qqImage];
    UIButton *qqButton = [[[UIButton alloc] initWithFrame:CGRectMake(qqImage.frame.origin.x, qqImage.frame.origin.y, qqImage.frame.size.width, qqImage.frame.size.height)] autorelease];
    [qqButton setBackgroundColor:[UIColor clearColor]];
    [root addSubview:qqButton];

    
}


- (void)logAction:(id)sender
{
    LogViewController *log = [[LogViewController alloc] init];
    [self.navigationController pushViewController:log animated:YES];
}














- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
